<template>
	<view>
		<u-tabbar :value="choseTabbar" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
			<u-tabbar-item text="首页" @click="choseTabbarMethod" icon="home"></u-tabbar-item>
			<u-tabbar-item text="放映厅" @click="choseTabbarMethod" icon="photo"></u-tabbar-item>
			<u-tabbar-item text="直播" @click="choseTabbarMethod" icon="play-right"></u-tabbar-item>
			<u-tabbar-item text="我的" @click="choseTabbarMethod" icon="account"></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		props: {
			choseTabbar: {
				type: String,
				default: '0'
			},
		},
		name: "tabbar",
		data() {
			return {

			};
		},
		methods: {
			choseTabbarMethod(e) {
				console.log('choseTabbarMethod', e);
				switch (e) {
					case 0:
						uni.switchTab({
							url: "/pages/index/index"
						})
						break;
					case 1:
						console.log('choseTabbarMethod', 'case');
						uni.navigateTo({
							url: "/pages/addItem/addItem"
						})
						break;
				}

			}
		}
	}
</script>

<style lang="scss">

</style>